<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Cities extends La_Controller {
	public function find_all_cities_ajax() {
		$province_id = intval($_GET['province_id']);
		$this->load->model('City_model');
		$cities = $this->City_model->find_all_cities($province_id);

		echo json_encode($cities);
		exit;
	}
	
	public function find_all_areas_ajax() {
		$city_id = intval($_GET['city_id']);
		$this->load->model('City_model');
		$areas = $this->City_model->find_all_areas($city_id);

		echo json_encode($areas);
		exit;
	}
}